﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using GameSite.Models;

namespace GameSite.Controllers
{
    public class DownLoadController : Controller
    {
        private GameA4Context dbContext = new GameA4Context();

        public DownLoadController()
        {
            GlobalViewModel.CacheDownload(ViewBag);
        }

        public ActionResult Index()
        {
            return View(dbContext.DownLoads.ToList());
        }

        public ActionResult Details(int id = 0)
        {
            DownLoad download = dbContext.DownLoads.Find(id);
            if (download == null)
            {
                return HttpNotFound();
            }
            return View(download);
        }

        protected override void Dispose(bool disposing)
        {
            dbContext.Dispose();
            base.Dispose(disposing);
        }
    }
}